#include "loadcontainer.h"

CLoadContainer::CLoadContainer()
{

}

CLoadContainer::~CLoadContainer()
{

}

int CLoadContainer::Init(_pinstance hinstance, const basic_tchar* path, const char* code)
{
	int rc = S_SUCCESS;
	logi("CreateContainer");
	m_Container.CreateContainer(path, tstring_strlen(path));
	rc_assert(rc == S_SUCCESS, E_FAIL)

	logi("RegisterContainer");
	m_Container.RegisterContainer(code, s_strlen(code));
	rc_assert(rc == S_SUCCESS, E_FAIL)

	logi("InitContainer");
	m_Container.InitContainer(NULL, NULL, 0);
	rc_assert(rc == S_SUCCESS, E_FAIL)

    return S_SUCCESS;
}

int CLoadContainer::UnInit(_pinstance hinstance)
{
	logi("UnInitContainer");
	return m_Container.UnInitContainer(hinstance);
}

int CLoadContainer::Start(_pinstance hinstance, UINT type)
{	
	logi("StartContainer");
    return m_Container.StartContainer(NULL, 0);
}

int CLoadContainer::Stop(_pinstance hinstance, UINT type, UINT exit)
{
	logi("StopContainer");
    return m_Container.StopContainer(NULL, 0, OBJECT_RUN_RET_SUCCESS);
}
int CLoadContainer::Exit(_pinstance hinstance, UINT exit)
{
	logi("ExitContainer");
	return m_Container.ExitContainer(hinstance, exit);
}